package com.test.webfluxhtml.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 由于webflux 目前的配置问题，使用netty 作为nio http服务需要自己进行配置初始化，因此使用自定义的配置文件
 */
@ConfigurationProperties(prefix = "spring.webflux.netty")
public class NettyHttpServerConfig {
//    public static final int DEFAULT_MAX_INITIAL_LINE_LENGTH = 4096;
//    public static final int DEFAULT_MAX_HEADER_SIZE         = 8192;
//    public static final int DEFAULT_MAX_CHUNK_SIZE          = 8192;
//    public static final boolean DEFAULT_VALIDATE_HEADERS    = true;
//    public static final int DEFAULT_INITIAL_BUFFER_SIZE     = 128;





    private int maxInitialLineLength = 4096;

    private int maxHeaderSize = 8192;

    private int maxChunkSize = 8192;

    private boolean validateHeaders = true;

    private int initialBufferSize =128;

    private int minCompressionResponseSize = -1;

    public int getMaxInitialLineLength() {
        return maxInitialLineLength;
    }

    public void setMaxInitialLineLength(int maxInitialLineLength) {
        this.maxInitialLineLength = maxInitialLineLength;
    }

    public int getMaxHeaderSize() {
        return maxHeaderSize;
    }

    public void setMaxHeaderSize(int maxHeaderSize) {
        this.maxHeaderSize = maxHeaderSize;
    }

    public int getMaxChunkSize() {
        return maxChunkSize;
    }

    public void setMaxChunkSize(int maxChunkSize) {
        this.maxChunkSize = maxChunkSize;
    }

    public boolean isValidateHeaders() {
        return validateHeaders;
    }

    public void setValidateHeaders(boolean validateHeaders) {
        this.validateHeaders = validateHeaders;
    }

    public int getInitialBufferSize() {
        return initialBufferSize;
    }

    public void setInitialBufferSize(int initialBufferSize) {
        this.initialBufferSize = initialBufferSize;
    }

    public int getMinCompressionResponseSize() {
        return minCompressionResponseSize;
    }

    public void setMinCompressionResponseSize(int minCompressionResponseSize) {
        this.minCompressionResponseSize = minCompressionResponseSize;
    }
}
